package com.sc.controller;

import com.sc.common.pojo.EasyUiTreeNode;
import com.sc.service.ItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by sc on 2017/10/10.
 */
@Controller
@RequestMapping("/item/cat")
public class ItemCatController {

    @Autowired
    private ItemCatService catService;


    @RequestMapping("/list")
    @ResponseBody
    public List<EasyUiTreeNode> getcatlist(@RequestParam(value = "id",defaultValue = "0") Long parentid){
        List<EasyUiTreeNode> list =  catService.getItemCat(parentid);
        return list;
    }
}
